<template>
  <div class="common-card">
    <div class="title">{{ title }}</div>
    <div class="line" v-if="pie"></div>
    <div class="chart" :class="{ pie: pie, table: table }">
      <slot></slot>
    </div>
    <div class="line" v-if="!pie"></div>
    <div class="total" v-if="!pie">
      <slot name="footer"></slot>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: String,
    pie: {
      type: Boolean,
      default: false
    },
    table: {
      type: Boolean,
      default: false
    }
    // chart: String,
    // total: String,
  }
};
</script>
<style scoped>
.common-card {
  padding: 20px;
  text-align: left;
}
.title {
  font-size: 12px;
  color: #999;
  margin-bottom: 16px;
}
.chart {
  width: 100%;
  height: 160px;
}
.pie.chart {
  height: 448px;
}
.table.chart {
  height: 438px;
}
.line {
  margin: 10px 0;
  border-top: 1px solid #eee;
}
.total {
  font-size: 12px;
  color: #666;
}
</style>
